  <script src="http://globalinfinite.com//themes/global/views/layouts/js/jquery-1.5.2.min.js" type="text/javascript"></script>
<h1>Aktivasi Member</h1>
<?php if ($show): ?>
    <?php $form  = $this->beginWidget('CActiveForm'); ?>
    <?php echo $form->hiddenField($model, 'fix', array('value' => 'active')); ?>
    <div class="add">
        <table cellpadding="0" cellspacing="0" border="0">
            <tr class="title">
                <th colspan="2" style="text-align:left;"><strong>DATA JARINGAN</strong></th>
            </tr>
            <tr valign="top">
                <th width="110">Sponsor ID</th>
                <td style="vertical-align:middle;">
                    <strong><?php echo $model->member_sponsor; ?></strong>
                    <?php echo $form->hiddenField($model, 'member_sponsor'); ?>
                    <?php echo $form->error($model, 'member_sponsor', array('style' => 'color:#d00; display:inline; padding-left:5px;')); ?><div id="tempat"></div>
                </td>
            </tr>
            <tr>
                <th valign="top">Upline ID</th>
                <td style="vertical-align:middle;">
                    <strong><?php echo $model->member_upline; ?></strong>
                    <?php echo $form->hiddenField($model, 'member_upline'); ?>
                    <?php echo $form->error($model, 'member_upline', array('style' => 'color:#d00; display:inline; padding-left:5px;')); ?><div id="tempat1"></div>
                </td>
            </tr>
            <tr>
                <th valign="top">Posisi</th>
                <td style="vertical-align:middle;">
                    <strong><?php echo ($model->position == 'L') ? 'Kiri' : 'Kanan'; ?></strong>
                    <?php echo $form->hiddenField($model, 'position'); ?>
                    <?php echo $form->error($model, 'position', array('style' => 'color:#d00; display:inline; padding-left:5px;')); ?>
                </td>
            </tr>
            <tr class="title">
                <th colspan="2" style="text-align:left;"><strong>DATA KARTU</strong></th>
            </tr>
            <tr>
                <th valign="top">Serial Number <font color="#dd0000" size="4">*</font></th>
                <td><?php echo $form->textField($model, 'serial_id', array('size' => '15', 'class' => 'text')); ?><?php echo $form->error($model, 'serial_id', array('style' => 'color:#d00; display:inline; padding-left:5px;')); ?></td>
            </tr>
            <tr>
                <th valign="top">PIN <font color="#dd0000" size="4">*</font></th>
                <td><?php echo $form->passwordField($model, 'serial_pin', array('size' => '15', 'class' => 'text')); ?><?php echo $form->error($model, 'serial_pin', array('style' => 'color:#d00; display:inline; padding-left:5px;')); ?></td>
            </tr>
            <tr class="title">
                <th colspan="2" style="text-align:left;"><strong>DATA LOGIN</strong></th>
            </tr>
            <tr>
                <th valign="top">Password <font color="#dd0000" size="4">*</font></th>
                <td><?php echo $form->passwordField($model, 'password', array('size' => '15', 'class' => 'text')); ?><?php echo $form->error($model, 'password', array('style' => 'color:#d00; display:inline; padding-left:5px;')); ?><br><small>password minimal 5 karakter</small></td>
            </tr>
            <tr>
                <th valign="top">Ulangi Password <font color="#dd0000" size="4">*</font></th>
                <td><?php echo $form->passwordField($model, 'password2', array('size' => '15', 'class' => 'text')); ?><?php echo $form->error($model, 'password2', array('style' => 'color:#d00; display:inline; padding-left:5px;')); ?></td>
            </tr>
            <tr class="title">
                <th colspan="2" style="text-align:left;"><strong>DATA PRIBADI</strong></th>
            </tr>
            <tr>
                <th valign="top">Nama Lengkap <font color="#dd0000" size="4">*</font></th>
                <td><?php echo $form->textField($model, 'member_name', array('size' => '30', 'class' => 'text', 'encode' => false,
                    'onchange'=>' displayMemberName(this);')); ?><?php echo $form->error($model, 'member_name', array('style' => 'color:#d00; display:inline; padding-left:5px;')); ?><br /><small>sesuaikan dengan rekening anda</small></td>
            </tr>
            <tr>
                <th valign="top">Nama Alias <font color="#dd0000" size="4">*</font></th>
                <td><?php echo $form->textField($model, 'member_nickname', array('size' => '30', 'class' => 'text')); ?><?php echo $form->error($model, 'member_nickname', array('style' => 'color:#d00; display:inline; padding-left:5px;')); ?></td>
            </tr>
            <tr>
                <th valign="top">E-mail</th>
                <td><?php echo $form->textField($model, 'member_email', array('size' => 50, 'class' => 'text')); ?></td>
            </tr>
            <tr>
                <th valign="top">No. Handphone <font color="#dd0000" size="4">*</font></th>
                <td><?php echo $form->textField($model, 'member_mobilephone', array('size' => 20, 'class' => 'text')); ?><?php echo $form->error($model, 'member_mobilephone', array('style' => 'color:#d00; display:inline; padding-left:5px;')); ?><br /><small>Nomor ini otomatis akan terdaftar sebagai Nomor Agen</small></td>
            </tr>
            <tr><th colspan="2" class="title" style="text-align:left;">Data Bank</th></tr>
            <tr>
                <td width="130" align="right">Nama Nasabah</td>
                <td id="target">
                  <?php
                   // echo $form->textField($model,'member_bank_account_name', array('size' => 40,));
                    ?>   
               
                </td>
            </tr>
             <tr>
                <td width="130" align="right">Nama Bank</td>
                <td>
                    <?php
                   // echo CHtml::activeDropDownList($model, 'member_bank_id', CHtml::listData(ref_bank::model()->findAll("bank_is_active = '1'"), 'bank_id', 'bank_name'));
                   echo $form->dropDownList($model,'member_bank_id',CHtml::listData(ref_bank::model()->findAll("bank_is_active = '1'"), 'bank_id', 'bank_name'));
                    ?>
                </td>
            </tr>
            <tr>
                <td width="130" align="right">Kota Bank</td>
                <td>
                    <?php
                    echo $form->textField($model,'member_bank_city', array('size' => 40,'value'=>'N/A')    );
                    ?>
                  
            </tr>
            <tr>
                <td width="130" align="right">Cabang</td>
                <td>
                    <?php
                    echo $form->textField($model,'member_bank_branch', array('size' => 40,'value'=>'N/A'));
                    ?> 
                   
                </td>
            </tr>
            
            <tr>
                <td width="130" align="right">Nomor Rekening</td>
                <td>
                  <?php
                    echo $form->textField($model,'member_bank_account_no', array('size' => 40,'value'=>'N/A'));
                    ?>     
                  
                </td>
            </tr> 
            
            <tr>
                <th>&nbsp;</th>
                <td>
                    <?php
                    $str_javascript = "var pos = get_checkbox();if(confirm('Sponsor anda: '+document.getElementById('" . CHtml::activeId($model, 'member_sponsor') . "').value+' \\r\\nUpline anda: '+document.getElementById('" . CHtml::activeId($model, 'member_upline') . "').value+'\\r\\nPosisi Node anda: '+pos+'\\r\\n\\r\\nApakah Anda yakin akan data tersebut ?')) return true; else return false;";
                    echo CHtml::submitButton('Register', array("onclick" => $str_javascript, 'encode' => false, "class" => "button"));
                    ?>
                </td>
            </tr>
        </table>
    </div>
    <script>
        
        function get_checkbox() {
            var pos = document.getElementsByName('registrasi_form[position]');
            var length = pos.length;
            for(var i = 0; i < length; i++) {
                if(pos[i].checked) {
                    var position = pos[i].value;
                }
            }
            return (position == 'R') ? 'kanan' : 'kiri';
        }  
    
    </script>
     <script type="text/javascript">
function displayMemberName(x)
{
            var pos = x.value;
            document.getElementById("target").innerHTML=pos;
}
</script>
    <br /> 
    <?php $this->endWidget(); ?>
<?php else: ?>
    <?php echo $message; ?>
<?php endif; ?>

   
    